<template>
  <div class="cus">
    <div class="cus_box" style="width:1000px;" v-loading="loading">
      <div class="title"><span>使用记录</span> <i @click="$emit('Affiliated_agents_call')" class="el-icon-close"></i></div>
      <div class="content">

        <el-form :inline="true" :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
          <el-form-item label="" prop="adName">
            <el-input v-model="dataForm.adName" type="text" placeholder="商家名称" style="width:150px;" clearable></el-input>
          </el-form-item>
          <el-form-item label="" prop="adName">
            <el-input v-model="dataForm.adName" type="text" placeholder="手机号" style="width:150px;" clearable></el-input>
          </el-form-item>
          <el-form-item label="" prop="adName">
            <el-input v-model="dataForm.adName" type="text" placeholder="上级代理商" style="width:150px;" clearable></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary">搜索</el-button>
          </el-form-item>

        </el-form>

        <el-table
          :data="tableData"
          height="450"
          highlight-current-row
          border
          style="width: 100%">
          <el-table-column
            prop="date"
            label="序号"
            width="180">
          </el-table-column>
          <el-table-column
            prop="name"
            label="代理商名称"
            width="180">
          </el-table-column>
          <el-table-column
            prop="address"
            label="代理商地址">
          </el-table-column>
          <el-table-column
            prop="address"
            label="联系人">
          </el-table-column>
          <el-table-column
            prop="address"
            label="手机号">
          </el-table-column>
          <el-table-column
            prop="address"
            label="设备信息">
          </el-table-column>
          <el-table-column
            prop="address"
            label="站点数量">
          </el-table-column>
          <el-table-column
            prop="address"
            label="状态">
          </el-table-column>
          <el-table-column
            prop="address"
            label="操作">
            <template slot-scope="scope">
              <el-button type="text">取消关联</el-button>
            </template>
          </el-table-column>
        </el-table>


        <div class="btns">
          <el-button @click="$emit('Affiliated_agents_call')">取消</el-button>
          <el-button type="primary" @click="dataFormSubmit()">关联</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import {isMobile } from '@/utils/validate'
  export default {
    data () {
      var validateMobile = (rule, value, callback) => {
        if (!isMobile(value)) {
          callback(new Error('手机号格式错误'))
        } else {
          callback()
        }
      };
      return {
        loading:false,
        fileList: [],
        src:'',
        dataForm: {
          adName:'',
          type:'',
          times:'',
          url:'',
          equipmentNos:''
        },
        equipmentNos_list:[],
        longitude:'',
        latitude:'',
        dataRule: {
          adName: [
            { required: true, message: '请输入', trigger: 'blur' }
          ],
          type: [
            { required: true, message: '请上传', trigger: 'blur' }
          ],
          equipmentNos:[
            { required: true, message: '请选择', trigger: 'blur' }
          ]
        },

        tableData: [{
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-08',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-06',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-07',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }]


      }
    },
    computed:{

    },
    components:{

    },
    props:['res'],


    methods: {

      // 表单提交
      dataFormSubmit () {
        this.$refs['dataForm'].validate((valid) => {
          if (valid) {

          }
        })
      },

    }
  }
</script>
<style scoped lang='scss'>

</style>
